import React, { Component } from 'react';
import { inject, observer } from 'mobx-react';
import { WeaDialog, WeaInputSearch } from "ecCom";
import { WeaTableNew } from 'comsMobx';

let WeaTable = WeaTableNew.WeaTable;

@inject('groupListStore')
@observer
export default class VotePersonList extends Component {
  static defaultProps = {
    prefixCls: 'group-voting-personlist'
  }

  /* 关闭Dialog */
  onCancel = () => {
    const { groupListStore } = this.props;
    const { setStoreState } = groupListStore;
    setStoreState({
      personVisible: false,
      personTitle: '',
    })
  }

  render() {
    const { prefixCls, groupListStore } = this.props;
    const { personVisible, personTitle, personListStore, groupchatvoteprelist } = groupListStore;
    return (
      <WeaDialog
        visible={personVisible}
        title={personTitle}
        icon='icon-portal-reportform'
        style={{ width: 600, height: 500 }}
        onCancel={this.onCancel}
        className={prefixCls}
      >
        <div className={`${prefixCls}-title`}>
          <WeaInputSearch
            onSearch={v => groupchatvoteprelist({ lastname: v })}
          />
        </div>
        <WeaTable
          comsWeaTableStore={personListStore}
          needScroll
        />
      </WeaDialog>
    )
  }
}
